<%@page import="java.util.*,studio7.modelo.Sala" session = "true"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%
Sala sala = (Sala)request.getAttribute("SALA");
 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>ReservaSalaEnsayo</title>
</head>
<body style="height: 546px; ">
<form action="ReservarServlet" method="post" style="height: 493px; "><input type="submit" value="Inicio"><input type="submit" value="Salas"><input type="submit" value="Usuarios"><input type="submit" value="Mantenimiento"><input type="submit" value="Reservas"><input type="submit" value="Sistema"><br><br><br>Reserva de Salas de Ensayo:<br>
		<br><br>Fecha: <input style="width: 146px; " name="fecha" ><br><br>Hora Inicio: <input style="width: 93px; " name="hora"> Hora Fin: 
		  <input name="horafin" style="width: 90px; "><br><br>Capacidad Max: <input style="" value="<%out.println(sala.getCapacidadmaxSala());%>" name="capacidadmax" > Costo Total: <input style="" value="<%out.println(sala.getCostoSala());%>" name="costototal">  Sala: <input style="" value="<%out.println(sala.getNombreSala());%>" name="sala"><br><br><table border="1" style="height: 121px; width: 385px; ">
			<%
			
			//Para los servicios adicionales
			Collection<String> servicios = (ArrayList<String>) request.getAttribute("SERVICIOS_ADICIONALES");
			Collection<String> instrumentos = (ArrayList<String>) request.getAttribute("INSTRUMENTOS_ADICIONALES");
		
		
	int a = 1;
	int b = 1;
	String etServ="",etIns="";
	%><input type="hidden" name= "cantservicio" value = "<%=servicios.size()%>"><%
	%><input type="hidden" name= "cantinstrumento" value = "<%=instrumentos.size()%>"><%
	for(String servicio : servicios){
	if (a==1){
	etServ= "Servicios Adicionales";
	} else {
	etServ="";
	}
	out.print("<tr><td><b>" + etServ + "</b></td></tr>");
	out.print("<tr><td>" + servicio + "</td></tr> "); 
	String nombre="check1";
	%> <tr><td><input type="checkbox" name="checkserv<%=a%>"></td></tr> 
	   <input type="hidden" name= "checkserv<%=a%>" value = "<%=servicios.size()%>">
	   <input type="hidden" name= "servicio<%=a%>" value = "<%=servicio%>">
	<%
	a++;
}
for(String instrumento : instrumentos){
	if (b==1){
	etIns="Instrumentos Adicionales";
	} else {
	etIns="";
	}
	out.print("<tr><td><b>" + etIns + "</b></td></tr>");
	out.print("<tr><td>" + instrumento + "</td></tr> "); 
	%> <tr><td><input type="checkbox" name="checkinst<%=b%>"></td></tr> 
	   <input type="hidden" name= "checkinst<%=b%>" value = "<%=instrumentos.size()%>">
	   <input type="hidden" name= "instrumento<%=b%>" value = "<%=instrumento%>">
	<%
		
	b++;
} 

	
%>

			
		</table><br><br><br><br><input type="submit" value="Reservar" style="width: 102px; "></form>
	
	
</body>
</html>